<template>
	<view>
		<button size="mini" @click="getUserProfile">获取用户信息</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			getUserProfile() {
				uni.getUserProfile({
					desc: '获取您的微信信息以授权小程序',
					success: userRes => {
						console.log('getUserProfile-res', userRes);
					},
					fail: userErr => {
						uni.showToast({
							title: '授权失败',
							icon: 'error'
						});
						console.log('getUserProfile-err', userErr);
					}
				});
			}
		}
	}
</script>

<style>

</style>
